/* @(#)GSBalanceManageAbolishAction.java   
 *
 * Project: GS
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   Jenny Li    2006-4-24     新增
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
 *        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
 *        Haidian District, Beijing ,100081, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with HiTRUST.
 *
 * Warning:
 * =============================================================================
 * 
 */
package com.hitrust.gs.action;

import java.util.HashMap;

import com.hitrust.gs.bean.GSOperatorBean;
import com.hitrust.gs.business.GSBalanceProcessor;
import com.hitrust.gs.business.GSOrderDeptInfoProcessor;
import com.hitrust.gs.form.GSBalanceManageAbolishForm;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;

/**
 * 
 */
public class GSBalanceManageAbolishAction extends GSBaseAction {

    public String execute(GSBaseForm aForm) throws Exception {
        GSBalanceManageAbolishForm tForm = (GSBalanceManageAbolishForm)aForm;
        String tDeptId = tForm.getDeptId();
        String tBalancYM = tForm.getBalanceYM();
        
        try{
            //取得当前操作员信息
            GSOperatorBean tOperBean = (GSOperatorBean)tForm.getSession().getAttribute(GSBaseConstants.LOGIN);
            GSBalanceProcessor tBalProc = new GSBalanceProcessor();
            //执行结算作废操作
            boolean tFlag = tBalProc.abolishBalanceInfo(tDeptId,tBalancYM,tOperBean);
            if(tFlag){
                tForm.getRequest().setAttribute("message","结算信息作废操作成功");
            }else{
                tForm.getRequest().setAttribute("message","结算信息作废操作失败");
            }
            
            GSOrderDeptInfoProcessor tProc = new GSOrderDeptInfoProcessor();
            HashMap tMap = tProc.getOrderDeptInfoOfBusOper(tOperBean.getGs_oper_org_id());
            tForm.getRequest().setAttribute("orderdept",tMap);
            tForm.getRequest().setAttribute("requery","true");
        }catch(Exception e){
            tForm.getRequest().setAttribute("action","A180201.do");
            throw e;
        }
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
